package cn.prophet.service.impl;

import cn.prophet.bean.VersionControl;
import cn.prophet.mapper.VersionControlMapper;
import cn.prophet.service.CommonService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Service
public class CommonServiceImpl implements CommonService{
    @Resource
    private VersionControlMapper controlMapper;
    @Override
    public Map<String,String> getServerVersion() {

        VersionControl versionControl = controlMapper.selectByPrimaryKey(1);
        int serverCode = versionControl.getVersionCode();
        Map<String,String> map = new HashMap<>(3);
        map.put("versionCode",String.valueOf(serverCode));
        map.put("versionName",versionControl.getVersionName());
        map.put("url",versionControl.getUrl());
        return map;
    }
}
